﻿using System;

namespace Startup.DataContract.Basic
{
	public abstract class DataContractBase
	{
		protected static readonly Random _random = new Random(DateTime.UtcNow.Millisecond);

		public abstract object Generate();
		public abstract Type GetDataType();

		public override bool Equals(object obj)
		{
			if (obj == null)
				return false;

			return GetHashCode() == obj.GetHashCode();
		}

		public override int GetHashCode()
		{
			return GetType().GetHashCode();
		}
	}

	public abstract class DataContractBase<T> : DataContractBase
	{
		public override Type GetDataType()
		{
			return typeof(T);
		}
	}
}
